<template>
		<div class="Footer">
			<div class="one">
				<a href="javascript:"><img src="../../assets/liu/收藏.png" /><br /><span>收藏</span></a>
			</div>
		   <div class="two">
				<a href="#/car"><img src="../../assets/liu/购物车.png" /><br /><span>购物车</span></a>
			</div>
			 <div class="there">
			 	<a href="javascript:"><span>加入购物车</span></a>
			 </div>
			 <div class="four" @click="getshopping">
			 	<a ><span>立即购买</span></a>
			 </div>
		</div>
</template>

<script>
	import axios from 'axios'
	var sql = require('../../../serve/mysql.js')
	export default{
		name:'Footer',
		methods:{
			getshopping:function(){
				var obj = localStorage.obj;
				var arr = JSON.parse(obj);
				 var _this = this;
				 if(arr[0].phone !==""){
				axios.get('http://localhost:3000/router/select',{
					params:{
							phone:arr[0].phone ,
							psw:arr[0].psw,
							condition: sql.user.select
						}
				}).then(function(res){
					if(res){
						_this.$emit('toParent');
						window.location.href="#/Pworder";
					}				
				});
				
				}else {
					window.location.href = '#/Login';
				}
			}
		}
	}
	
</script>

<style scoped>
	a{
		text-decoration: none;
		color: dimgray;
	}
	.Footer {
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 10;
		text-align: center;
		width: 100%;
		height: 5rem;
		background-color: #fafafa;
		box-sizing: border-box;
		
	}
	.Footer .one img{
		width: 2.3rem;
	}
	.Footer .two img{
		width: 2.4rem;
	}
	.Footer .one{
		width: 25%;
		height: 5rem;
		float: left;
		padding-top: 0.7rem;
	}
	.Footer .two{
		width: 25%;
		height: 5rem;
		float: left;
		padding-top: 0.7rem;
	}
	.Footer .there{
		width: 26%;
		line-height: 5rem;
		float: left;
		background:linear-gradient(to right,#FAC905 0,#FF9500 100%);
	}
	.Footer .four{
		width: 24%;
		line-height: 5rem;
		float: left;
		background:linear-gradient(to right,#FA1E8C 0,#FC1E56 100%);
	}
	.Footer .there span{
		color: white; 
		font-size: 1.5rem
	}
	.Footer .four span{
		color: white; 
		font-size: 1.5rem
	}
</style>